/*
 * @lc app=leetcode id=190 lang=cpp
 *
 * [190] Reverse Bits
 */
class Solution {
public:
    uint32_t reverseBits(uint32_t n) {
        uint32_t r = 0;

        int i=0;
        while(i<32) {
            r = r << 1 | (n>>i & 1);
            i++;
        }
        return r;
        
    }
};

